/*
 * @Description:
 * @version:
 * @Author: sunqian_sr
 * @Date: 2023-01-31 19:01:51
 * @LastEditors: Andy
 * @LastEditTime: 2023-02-14 17:29:10
 */
import { Http } from '@/common/api'

// 列表
export const listUrl = '/upms/area/page'

/**
 * 查询区域树
 * @param params
 * @return {*|Promise}
 */
export const apiPostAreaTree = async (params) => Http.post('/upms/area/tree', params)
/**
 * 新增区域
 * @param params
 * @return {*|Promise}
 */
export const apiPostAddArea = async (params) => Http.post('/upms/area/add', params)
/**
 * 编辑区域
 * @param params
 * @return {*|Promise}
 */
export const apiPutUpdateArea = async (params) => Http.put('/upms/area/update', params)

/**
 * 根据ID查询区域详情
 * @param areaId
 * @return {*|Promise}
 */
export const apiGetAreaInfo = async (areaId) => Http.get(`/upms/area/detail?areaId=${areaId}`)

/**
 * 删除区域
 * @param params
 * @return {*|Promise}
 */
export const apiPutDeleteArea = async (params) => Http.put('/upms/area/delete', params)
/**
 * 批量启用
 * @param params
 * @return {*|Promise}
 */
export const apiPutEnableArea = async (params) => Http.put('/upms/area/batch/enable', params)

/**
 * 批量停用
 * @param params
 * @return {*|Promise}
 */
export const apiPutDisableArea = async (params) => Http.put('/upms/area/batch/disable', params)
